package cn.edu.dao;

import cn.edu.pojo.User;
import org.apache.ibatis.annotations.Many;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;

/**
 * @author wans
 * @create 2022-09-18 18:35
 */
public interface UserMapper {
    User findByID(int id);
    @Select("select * from users where uid=#{id} ")
    @Results({
            @Result(id = true,column = "uid",property = "uid"),
            @Result(column = "uname",property = "uname"),
            @Result(column = "uage",property = "uage"),
            @Result(column = "uid",property = "orderList",
                    many = @Many(select = "cn.edu.dao.OrderMapper.selectOrdersByUserId"))})
    User selectUserById(int id);

}
